package com.ashok.action;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opensymphony.xwork2.ActionSupport;

public class LogoutAction extends ActionSupport implements SessionAware{
	private static final Logger LOGGER = LoggerFactory
			.getLogger(LoginAction.class);
	private Map<String, Object> session;
	@Override
	public void setSession(Map<String, Object> session) {
		this.session = session;
		
	}
	@Override
	public String execute(){
		LOGGER.info("Now user "+session.get("user") +" is going to logout");
		session.clear();
		
		return SUCCESS;
	}
}
